"""
URL configuration for E_InvoiceAI project.

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/5.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path

from invoice import views
from invoice import report_views



urlpatterns = [
    # path('admin/', admin.site.urls),
    path('hello/', views.hello, name='hello'),
    path('article/', views.ArticleDetail.as_view(), name='article-detail'),

    # 演示 dify iframe嵌入
    path('embedding_app/', views.embedding_app, name='embedding_app'),
    # 演示 dify 调用Http集成—查询数据,返回json格式,接收参数id
    path('query_data/', views.query_data, name='query_data'),
    # 演示 dify 调用Http集成—传递发票文件,接收文件流,保存到本地，图片格式
    path('save_invoice_file', views.save_invoice_file, name='save_invoice_file'),
    # 4.6 Dify调用Http集成—返回Excel文件
    path('invoice_output/', views.InvoiceOutputView.as_view(), name='invoice_output'),
    # 4.7 绑定用户
    path('bind_user/', views.DifyBindUserView.as_view(), name='bind_user'),
    # 4.8 Dify调用Http集成—传递发票数据,接收json格式
    path('export_excel', views.ExportExcelToDifyView.as_view(), name='export_excel'),
    # 多张发票导出到excel文件
    path('export_excel2', views.ExportExcelToDifyView2.as_view(), name='export_excel2'),
    # 4.9 Dify调用Http集成—传递发票文件,存储发票图片（多张）
    path('save_invoice_images', views.save_invoice_images, name='save_invoice_images'),
    # 4.10 查询dify用户是否已经绑定
    path('check_dify_user_bound', views.check_dify_user_bound, name='check_dify_user_bound'),
    # 4.11 绑定dify用户
    path('bind_dify_user', views.bind_dify_user, name='bind_dify_user'),
    
    # 发票列表页面访问路由
    path('to_invoice_list', views.to_invoice_list, name='to_invoice_list'),
    # 查询发票数据API接口（旧版，GET请求）
    path('invoice_list', views.InvoiceList.as_view(), name='invoice_list'),
    # 查询发票数据API接口（新版，带条件查询，POST请求）
    path('query_invoices', views.QueryInvoiceList.as_view(), name='query_invoices'),
    # 查询发票列表API接口
    path('query_invoices', views.QueryInvoiceList.as_view(), name='query_invoice_list'),
    # 查询发票详情API接口
    path('query_invoice_detail', views.QueryInvoiceDetail.as_view(), name='query_invoice_detail'),
    # 查询发票图片API接口
    path('query_invoice_image', views.QueryInvoiceImage.as_view(), name='query_invoice_image'),
    # 导出发票Excel文件API接口
    path('export_invoice_excel', views.ExportInvoiceExcel.as_view(), name='export_invoice_excel'),
    # 报表模块—按天统计的界面
    path('to_day_statistics', report_views.to_day_statistics_invoice, name='to_day_statistics_invoice'),
    # 按天统计报表数据接口api
    path('data_day_statistics', report_views.day_statistics_invoice, name='day_statistics_invoice'),
    # 报表模块—按月统计的界面
    path('to_month_statistics', report_views.to_month_statistics_invoice, name='to_month_statistics_invoice'),
    # 按月统计报表数据接口api
    path('data_month_statistics', report_views.month_statistics_invoice, name='month_statistics_invoice'),
    # 报表模块—按季度统计的界面
    path('to_season_statistics', report_views.to_season_statistics, name='to_quarter_statistics'),
    # 按季度统计报表数据接口api
    path('data_season_statistics', report_views.data_season_statistics, name='data_season_statistics'),
    # 报表模块—按年度统计的界面
    path('to_year_statistics', report_views.to_year_statistics, name='to_year_statistics'),
    # 按年度统计报表数据接口api
    path('data_year_statistics', report_views.data_year_statistics, name='data_year_statistics'),
]
